package com.it.demo;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author げっしょく
 * @date 2021/8/8
 */
public class Demo3 {
    public static void main(String[] args) {
        AtomicInteger ai = new AtomicInteger(10);
        System.out.println(ai.get());
        System.out.println(ai.getAndIncrement());
        System.out.println(ai.get());
        System.out.println(ai.incrementAndGet());
        System.out.println(ai.get());
        System.out.println(ai.addAndGet(8));
        System.out.println(ai.getAndSet(10));
        System.out.println(ai.get());
    }
}
